from .common import *

class ModelGeneratorPage1(wx.adv.WizardPage):
    '''信息介绍页（实际上是Panel的子类）'''
    def __init__(self, parent, title='主要功能说明', out_data = None):
        WizardPageSimple.__init__(self, parent)
        self.next = self.prev = None
        self.sizer = wx.BoxSizer(wx.VERTICAL)

        self.SetSizer(self.sizer)

        if out_data is not None:
            self.out_data = out_data
            if MODELS_WIZARD_CONTEXT not in self.out_data:
                self.out_data[MODELS_WIZARD_CONTEXT] = {}
            self.context = self.out_data[MODELS_WIZARD_CONTEXT] # 简写
        else:
            self.out_data = None

        '''
            设置当前页标题
        '''
        title = wx.StaticText(self, -1, title)
        title.SetFont(wx.Font(18, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))
        self.sizer.Add(title, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
        self.sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.ALL, 5) # 水平分割线

        '''
            所有的其他控件全部放在滚动面板中
        '''
        self.scollPanel = scrolledpanel.ScrolledPanel(self, -1, size=SIZE) # 定义滚动面板
        self.scollPanel.SetupScrolling() # 开启滚动
        scollPanelSizer = wx.BoxSizer(wx.VERTICAL)
        self.scollPanel.SetSizer(scollPanelSizer)
        self.sizer.Add(self.scollPanel, 1, wx.EXPAND | wx.ALL, 2) # 加入主容器

        scollPanelSizer.Add(wx.StaticText(self.scollPanel, -1, '（后期补全）'), 0, wx.ALL, 5)

    def SetNext(self, next):
        '''设置后一页'''
        self.next = next

    def SetPrev(self, prev):
        '''设置前一页'''
        self.prev = prev

    def GetNext(self):
        '''获取下一页/下一指定页'''
        return self.next

    def GetPrev(self):
        '''获取上一页/上一指定页'''
        return self.prev
